package com.ce.pms.exception;

public class BusinessException extends BaseUnCheckedException {
	private static final long serialVersionUID = 2631490367837964951L;

	/**
	 * 警告
	 */
	public static final String WARNING = "warning";

	/**
	 * 错误
	 */
	public static final String ERROR = "error";

	/**
	 * 失败
	 */
	public static final String FAILURE = "failure";

	private String type = ERROR;

	/**
	 * 指定异常信息的构造器
	 *
	 * @param msg
	 *            异常信息
	 */
	public BusinessException(String msg) {
		super(msg);
	}

	/**
	 * 同时指定父异常和异常信息的构造器
	 *
	 * @param message
	 *            异常信息
	 * @param cause
	 *            父异常
	 */
	public BusinessException(String message, Throwable cause) {
		super(message, cause);
	}

	public BusinessException(String message, String type) {
		super(message);
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}
